﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MutFormStudio {

	/// <summary>FormStudio对应的</summary>
	public interface StudioControl {
		/// <summary>控件名称字符串，在关闭界面后需要恢复时，需要字符串来识别对应的界面</summary>
		string Create_str { get; }
		/// <summary>控件标题的名字</summary>
		string Head_text { get; set; }
		/// <summary>控件标题的背景颜色</summary>
		Color Head_color { get; }
		ContextMenuStrip HeadContextMenuStrip { get; }
		Action dHeadTestChanged { get; set; }
	}

	public static class Control_expand {
		public static string get_Head_text(this Control control) {
			if (control is StudioControl) {
				return ((StudioControl)control).Create_str;
			} else {
				return control.Name;
			}
		}
		public static void setHeadText(this StudioControl sc,string s) {
			sc.Head_text = s;
			sc.dHeadTestChanged?.Invoke();
		}
	}
}
